var express = require('express');
var router = new express.Router();
var employees=require('./data/employees')

router.get('/list', function (req, res) {

  res.send(employees);

})

//var employee=require('./data/employee')


router.get('/add',function (request,response) {
  console.log(request.query);
  if(request.query.id==-1) {
    employees.unshift(request.query)
  }else {}
  response.send({
    emps:employees,
    flag:true
  })
})


module.exports= router;
//module.exports = employee.list;
